<div class="zi_ren chantu layui-hide">
    <div class="men">
        <div class="xiaotit">材料物资分析</div>
        <div class="yingshou wd50" style="margin: 0 auto">
            <div class="bbfang float-l bbflv">
                <div style="margin-top: 16px">材料入库</div>
                <div class="fw700"><span id="zi_ren_listrumoney">0</span></div>
            </div>
            <div class="bbfang float-l bbfhuang">
                <div style="margin-top: 16px">材料出库</div>
                <div class="fw700"><span id="zi_ren_listchumoney">0</span></div>
            </div>
            <div class="bbfang float-l bbfheihuang">
                <div style="margin-top: 16px">材料退库</div>
                <div class="fw700"><span id="zi_ren_listtuimoney">0</span></div>
            </div>
            <div class="bbfang float-l bbfzi">
                <div style="margin-top: 16px">材料库存</div>
                <div class="fw700"><span id="zi_ren_listcunmoney">0</span></div>
            </div>
            <div class="bbfang float-l bbfhong">
                <div style="margin-top: 16px">材料耗用</div>
                <div class="fw700"><span id="zi_ren_listyongmoney">0</span></div>
            </div>
        </div>
        <div class="clear" style="height: 50px"></div>
    </div>
    <div class="xiaoxian"></div>
    <div class="men">
        <div class="xiaotit">人材机分包合同结算分析</div>
        <div style="width: 900px;margin: 0 auto">
            <div class="float-l" style="width: 600px">
                <div class="chart" id="zi_chart_rcjhejie" style="height: 400px"></div>
            </div>
            <div class="float-l" style="padding-top: 10px;width: 300px;">
                <div class="float-l fangding" style="padding-left: 20px;padding-top: 5px;">
                    <span class="fanglan tuclr1"></span><span style="margin-left: 20px">材料费合同：<span id="zi_ren_cai_hefee">0</span></span>
                </div><div class="clear"></div>
                <div class="float-l fangding" style="padding-left: 20px;padding-top: 5px;">
                    <span class="fanglan tuclr7"></span><span style="margin-left: 20px">合同结算：<span id="zi_ren_cai_jiefee">0</span></span>
                </div><div class="clear" style="padding-top: 25px"></div>

                <div class="float-l fangding" style="padding-left: 20px;padding-top: 5px;">
                    <span class="fanglan tuclr1"></span><span style="margin-left: 20px">人工费合同：<span id="zi_ren_ren_hefee">0</span></span>
                </div><div class="clear"></div>
                <div class="float-l fangding" style="padding-left: 20px;padding-top: 5px;">
                    <span class="fanglan tuclr7"></span><span style="margin-left: 20px">合同结算：<span id="zi_ren_ren_jiefee">0</span></span>
                </div><div class="clear" style="padding-top: 25px"></div>

                <div class="float-l fangding" style="padding-left: 20px;padding-top: 5px;">
                    <span class="fanglan tuclr1"></span><span style="margin-left: 20px">机械设备费合同：<span id="zi_ren_ji_hefee">0</span></span>
                </div><div class="clear"></div>
                <div class="float-l fangding" style="padding-left: 20px;padding-top: 5px;">
                    <span class="fanglan tuclr7"></span><span style="margin-left: 20px">合同结算：<span id="zi_ren_ji_jiefee">0</span></span>
                </div><div class="clear" style="padding-top: 28px"></div>

                <div class="float-l fangding" style="padding-left: 20px;padding-top: 5px;">
                    <span class="fanglan tuclr1"></span><span style="margin-left: 20px">专业分包合同：<span id="zi_ren_fen_hefee">0</span></span>
                </div><div class="clear"></div>
                <div class="float-l fangding" style="padding-left: 20px;padding-top: 5px;">
                    <span class="fanglan tuclr7"></span><span style="margin-left: 20px">合同结算：<span id="zi_ren_fen_jiefee">0</span></span>
                </div><div class="clear" style="padding-top: 28px"></div>

                <div class="float-l fangding" style="padding-left: 20px;padding-top: 5px;">
                    <span class="fanglan tuclr1"></span><span style="margin-left: 20px">其他合同：<span id="zi_ren_qi_hefee">0</span></span>
                </div><div class="clear"></div>
                <div class="float-l fangding" style="padding-left: 20px;padding-top: 5px;">
                    <span class="fanglan tuclr7"></span><span style="margin-left: 20px">合同结算：<span id="zi_ren_qi_jiefee">0</span></span>
                </div><div class="clear"></div>
            </div>
        </div>

        <div class="clear"></div>
    </div>
</div>
<script>

    function func_zi_ren() {
        layui.use(['laytp', 'form', 'element'], function() {
            var form = layui.form, layer = layui.layer, element = layui.element;

            facade.ajax({url: ask_engin_cha_zi_ren,data:{enginid:param_enginid}}).done(function(res){
                if (res.code === 2000) {
                    var data = res.data;


                    $("#zi_ren_listrumoney").html(parseFormatNum(data.stuff.listrumoney)).addClass('colorlan').click(function () {
                        openNavPage('查看材料库存信息','stuff_ku/index.php?isku=0&enginid='+data.id);
                    });
                    $("#zi_ren_listchumoney").html(parseFormatNum(data.stuff.listchumoney)).addClass('colorlan').click(function () {
                        openNavPage('查看材料库存信息','stuff_ku/index.php?isku=0&enginid='+data.id);
                    });
                    $("#zi_ren_listtuimoney").html(parseFormatNum(data.stuff.listtuimoney)).addClass('colorlan').click(function () {
                        openNavPage('查看材料库存信息','stuff_ku/index.php?isku=0&enginid='+data.id);
                    });
                    $("#zi_ren_listcunmoney").html(parseFormatNum(data.stuff.listcunmoney)).addClass('colorlan').click(function () {
                        openNavPage('查看材料库存信息','stuff_ku/index.php?isku=0&enginid='+data.id);
                    });
                    $("#zi_ren_listyongmoney").html(parseFormatNum(data.stuff.listyongmoney)).addClass('colorlan').click(function () {
                        openNavPage('查看材料库存信息','stuff_ku/index.php?isku=0&enginid='+data.id);
                    });

                    zi_chart_rcjhejie('zi_chart_rcjhejie', data);
                    $("#zi_ren_cai_hefee").text(parseFormatNum(data.cai_hefee)).addClass('colorlan').click(function () {
                        openNavPage('查看支出合同信息','contract_cai/index.php?status=1&caitype=cai&enginid='+data.id);
                    });
                    $("#zi_ren_ren_hefee").text(parseFormatNum(data.ren_hefee)).addClass('colorlan').click(function () {
                        openNavPage('查看支出合同信息','contract_cai/index.php?status=1&caitype=ren&enginid='+data.id);
                    });
                    $("#zi_ren_ji_hefee").text(parseFormatNum(data.ji_hefee)).addClass('colorlan').click(function () {
                        openNavPage('查看支出合同信息','contract_cai/index.php?status=1&caitype=ji&enginid='+data.id);
                    });
                    $("#zi_ren_fen_hefee").text(parseFormatNum(data.fen_hefee)).addClass('colorlan').click(function () {
                        openNavPage('查看支出合同信息','contract_cai/index.php?status=1&caitype=fen&enginid='+data.id);
                    });
                    $("#zi_ren_qi_hefee").text(parseFormatNum(data.qi_hefee)).addClass('colorlan').click(function () {
                        openNavPage('查看支出合同信息','contract_cai/index.php?status=1&caitype=qi&enginid='+data.id);
                    });
                    $("#zi_ren_cai_jiefee").text(parseFormatNum(data.cai_jiefee)).addClass('colorlan').click(function () {
                        openNavPage('查看支出合同结算信息','contract_cai_jie/index.php?status=1&caitype=cai&isreal=1&enginid='+data.id);
                    });
                    $("#zi_ren_ren_jiefee").text(parseFormatNum(data.ren_jiefee)).addClass('colorlan').click(function () {
                        openNavPage('查看支出合同结算信息','contract_cai_jie/index.php?status=1&caitype=ren&isreal=1&enginid='+data.id);
                    });
                    $("#zi_ren_ji_jiefee").text(parseFormatNum(data.ji_jiefee)).addClass('colorlan').click(function () {
                        openNavPage('查看支出合同结算信息','contract_cai_jie/index.php?status=1&caitype=ji&isreal=1&enginid='+data.id);
                    });
                    $("#zi_ren_fen_jiefee").text(parseFormatNum(data.fen_jiefee)).addClass('colorlan').click(function () {
                        openNavPage('查看支出合同结算信息','contract_cai_jie/index.php?status=1&caitype=fen&isreal=1&enginid='+data.id);
                    });
                    $("#zi_ren_qi_jiefee").text(parseFormatNum(data.qi_jiefee)).addClass('colorlan').click(function () {
                        openNavPage('查看支出合同结算信息','contract_cai_jie/index.php?status=1&caitype=qi&isreal=1&enginid='+data.id);
                    });
                }
            });
        });
    }

    function zi_chart_rcjhejie(chat_id, data) {
        var mychat = echarts.init(document.getElementById(chat_id), 'dark');
        mychat.clear();
        option = {
            color: [colors[1], colors[7]],
            backgroundColor: '#FFFFFF',
            tooltip: {
                trigger: 'axis',
                axisPointer: {
                    type: 'shadow'
                }
            },
            grid: {
                top: '1px',
                bottom: '1px',
                left: '1px',
                right: '1px',
                containLabel: true
            },
            xAxis: {
                type: 'value',
                boundaryGap: [0, 0.01]
            },
            yAxis: {
                type: 'category',
                data: ['其他', '专业分包', '机械设备', '人工', '材料']
            },
            series: [
                {
                    name: '合同金额',
                    type: 'bar',
                    data: [ data.qi_hefee,  data.fen_hefee,  data.ji_hefee,  data.ren_hefee, data.cai_hefee]
                },
                {
                    name: '合同结算',
                    type: 'bar',
                    data: [ data.qi_jiefee,  data.fen_jiefee,  data.ji_jiefee,  data.ren_jiefee,  data.cai_jiefee]
                }
            ]
        };
        mychat.setOption(option);
    }


</script>

